home *** CD-ROM | disk | FTP | other *** search
/ Ahoy 1984 January to June / Ahoy_Magazine_84-Jan-Jun_1984_Double_L.d64 / lunar lander (.txt) < prev    next >
Commodore BASIC  |  2022-10-26  |  5KB  |  165 lines

  1. 0 rem--ahoy--april issue--lunar lander--prog page 35
  2. 5 rem dec.19, 1983
  3. 6 poke53280,8:poke53281,0
  4. 10 print"[147]             lunar lander"
  5. 20 print"          (c) copyright 1983"
  6. 30 print"            by anthony wood"
  7. 50 poke55,248:poke56,157:rem 40440
  8. 60 clr:s=54272
  9. 100 v=53248:s1=64*13:s2=64*14:s3=64*15:k=2040:sr=40444
  10. 110 forz=0to39:reada:poke40456+z,a
  11. 120 pokes2+z,a:pokes3+z,a:next
  12. 130 for z=40to62:reada:poke40456+z,a:next
  13. 132 forz=40to62:reada:pokes2+z,a:next
  14. 134 forz=40to62:reada:pokes3+z,a:next
  15. 135 forz=1to63*3:reada:poke40518+z,a:next
  16. 137 forz=0to13:reada:poke40441+z,a:next
  17. 138 sys40441
  18. 139 fu=5000:f2=0:l1=0:l2=0:sc=0:gosub700
  19. 140 gosub900:pokev+39,1:pokek,13:pokev,0:pokev+1,0:pokev+21,1
  20. 150 h=15:e=5:x=30+int(rnd(0)*100):y=30:f(0)=13:f(1)=13:f(2)=14
  21. 160 f(3)=15:m=1
  22. 200 j=peek(56320):p=peek(197):iffu=0thenb=0:m=1:pokes+1,0:goto220
  23. 210 ifp=60or(jand16)=0thenb=b+1:goto213
  24. 211 b=0:m=1:pokes+4,0
  25. 213 ifm<>1thenpokes+4,129
  26. 215 if p=7or(jand4)=0thenh=h-1:print"<<":fu=fu-1
  27. 216 if p=2or(jand8)=0thenh=h+1:print">>":fu=fu-1
  28. 220 gosub760:ifb=6orb=1thenm=m+1
  29. 240 e=e+gr-m*1.65:fu=fu-(m-1)*10:iffu<0thenfu=0
  30. 245 x=x+int(h/6):y=y+int(e/5)
  31. 250 ifx<5thenx=5
  32. 252 ify>251theny=252:gosub800:y=35:x=29:ru=5000:f2=1:gosub5000
  33. 255 ify<35theny=35:e=3
  34. 256 ifx>319thenx=319
  35. 260 pokek,13:z=peek(v+31):gosub800
  36. 266 ifpeek(v+31)<>0then300
  37. 270 pokek,f(m-fl):iffl=0thenfl=1:goto200
  38. 280 fl=0:goto200
  39. 300 iff2=1then440
  40. 310 ify<149then270
  41. 320 ify<227 orx<099or x>123 ore>9orabs(h)>10then330
  42. 322 if l1=1andl2=1then330
  43. 325 y=227:gosub800:sc=sc+100:l2=1
  44. 327 goto400
  45. 330 ify<177 orx<197 orx>203 ore>9orabs(h)>10then340
  46. 335 y=179:gosub800:sc=sc+500:l1=1:goto400
  47. 340 pokes+4,129:v2=11:pokesr,63+8:sys40441:gosub820:pokesr,126+8:sys40441
  48. 350 gosub840:pokesr,189+8:sys40441:gosub840:pokes+4,0:pokes+24,15:pokes+1,2
  49. 360 pokev+21,0:pokesr,8:sys40441:goto410
  50. 400 pokes+4,0:gosub750:print" landed!!"
  51. 410 geta$:ifa$<>"[136]"then410
  52. 415 pokev+21,0:print"          "
  53. 420 iffu=0then 460
  54. 425 iff2=1theny=10:x=29:e=5:h=0:gosub5000:pokev,x:pokev+1,y:pokev+21,1:goto160
  55. 435 goto140
  56. 440 ifx<230orx>242ory<121ory>130ore>9orabs(h)>11then340
  57. 450 f2=0:sc=sc+1000:l1=0:l2=0:fu=4500:goto400
  58. 460 print"[147]":print:print"do you want to play again?"
  59. 470 geta$:ifa$=""then470
  60. 480 ifa$="y"then139
  61. 490 ifa$<>"n"then470
  62. 500 pokes+4,0:print"[147]":end
  63. 700 print:print:print"  enter gravity stringth (1[146],2[146], or 3[146])"
  64. 701 pokes+5,129:pokes+6,216:pokes+24,15
  65. 702 pokes,200:pokes+4,0:pokes+1,2
  66. 710 geta$:ifa$=""then710
  67. 715 ifa$="1"thengr=3:return
  68. 720 ifa$="2"thengr=3.6:return
  69. 730 ifa$="3"thengr=4.25:return
  70. 740 goto710
  71. 750 print"score";sc;
  72. 760 print"  ";tab(28);"fuel     [157][157][157][157][157]";fu;:return
  73. 800 pokev+1,y:ifx<256thenpokev,x:pokev+16,0:return
  74. 810 pokev,x-256:poke53264,127:return
  75. 820 pokes+1,3:forx=1to4:pokes+24,v2:fory=1to15:next:v2=v2+1
  76. 830 next:return
  77. 840 forx=1to7:pokes+24,v2:fory=1to9:next:v2=v2-1:next:return
  78. 900 print"[147]":gosub750:print:fory=0to9:a=rnd(0)
  79. 910 ifa>.3thenprinttab(rnd(0)*39);"."
  80. 920 if a<=.3thenprint
  81. 930 next:print:print:print
  82. 1000 print"                              [169][223][146]    "
  83. 1100 print"                             [169]  [223][146]     "
  84. 1200 print"                           [169]      [223][146]   "
  85. 1300 print"                         [169]          [223][146]  "
  86. 1400 print"                       [169]             [223][146]"
  87. 1500 print"                   [169]500               [223][146]"
  88. 1600 print"    [169][223][146]              [169]                  [146]"
  89. 1700 print"   [169]  [223][146]           [169]                    [146]"
  90. 1800 print"  [169]     [223][146]       [169]                      [146]"
  91. 1900 print"[169]         [223][146]   [169]                        [146]"
  92. 1910 print"           100                         [146]";
  93. 1920 ifl2=1andl1=1thenprint"[223][146]    [169][146]";
  94. 1930 return
  95. 1999 rem lander sprites
  96. 2000 data 0,255,0,0,255,0,7,255,224,7
  97. 2010 data 255,224,7,255,224,0,255,0,0,255
  98. 2020 data 0,15,255,240,15,255,240,15,255,240
  99. 2030 data 3,255,192,3,60,192,6,126,96,12
  100. 2040 rem no flame
  101. 2050 data 0,48,24,0,24,0,0,0,0,0
  102. 2060 data 0,0,0,0,0,0,0,0,0,0,0,0,0
  103. 2070 rem small flame
  104. 2080 data 0,48,24,60,24,0,102,0,0,60
  105. 2090 data 0,0,24,0,0,24,0,0,0,0,0,0,0
  106. 2100 rem  big flame
  107. 2110 data 0,48,24,126,24,0,219,0,0,219
  108. 2120 data 0,0,102,0,0,60,0,0,24,0,0,24,0
  109. 2130 rem explosion
  110. 2140 data 0,0,0,0,0,0,0,0
  111. 2150 data 0,0,0,0,0,0,0,0
  112. 2160 data 64,0,6,72,0,0,24,0
  113. 2170 data 12,224,0,0,228,0,0,0
  114. 2180 data 0,13,80,0,0,0,0,0
  115. 2190 data 0,0,0,0,0,0,0,0,0,0,0,0,0
  116. 2200 data 0,0,0,0,0,0,0,0,0,0
  117. 2210 rem frame 2 of explosion
  118. 2220 data 0,0,0,0,0,0,0,0
  119. 2230 data 0,0,128,0,24,131,0,24
  120. 2240 data 3,0,0,0,0,0,0,0
  121. 2250 data 48,224,0,48,227,0,0,0
  122. 2260 data 0,0,0,0,28,0,0,24
  123. 2270 data 152,0,2,8,0,0,64,0
  124. 2280 data 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
  125. 2290 rem frame 3 of explosion
  126. 2300 data 0,0,0,0,0,0,0,0
  127. 2310 data 0,0,128,128,24,129,0,24
  128. 2320 data 0,0,0,0,0,0,0,0
  129. 2330 data 64,0,0,64,0,112,0,0
  130. 2340 data 0,0,0,0,32,0,208,32
  131. 2350 data 0,0,0,0,0,0,2,0
  132. 2360 data 4,65,0,4,64,128,0,0
  133. 2370 data 0,0,0,0,0,0,0
  134. 2380 rem block move
  135. 2390 data 162,0,189,8,158,157,64,3,232
  136. 2400 data 224,63,208,245,96
  137. 4999 rem draw cave
  138. 5000 print"[147]":gosub750:print:pokes+4,0:pokes+1,2
  139. 5005 print"                                       "
  140. 5010 print"                                       "
  141. 5020 print"                                       "
  142. 5030 print"                                       "
  143. 5040 print"                                       "
  144. 5050 print"                         [146][169]  [223][169] [223] [146][169]  [223]  "
  145. 5060 print"                         [146]              "
  146. 5065 print"                         [146]              "
  147. 5070 print"                         [146]              "
  148. 5080 print"                          [146] [175][175][175][175]        "
  149. 5090 print"                                   [146]     "
  150. 5100 print"                          1000   [146])     "
  151. 5200 print"                                [146])      "
  152. 5210 print"                                [146])      "
  153. 5220 print"                              [146])        "
  154. 5230 print"     [223][169][223][169][223][169][223][169][223]   [146][169][223]  [146][169][223][169][223]  [146][169][223][169]         "
  155. 5240 print"              [223][169]                    [169] [146]"
  156. 5250 print"                                  [169]  [146]"
  157. 5260 print"                                [169]   [146]"
  158. 5270 print"                               [169]     [146]"
  159. 5280 print"                              [169]       [146]"
  160. 5285 print"             [169][223][146]                     [146]"
  161. 5290 print"                                       [146]"
  162. 5295 print"                                       [146]";
  163. 5300 print"";tab(38);" [157] [157] [157] [157] [157] [157] [157] [157] [157] [157] [157] [157] [157] [157] [157] [146]";
  164. 6000 return
  165.